<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <title>糖尿病预测服务站</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
</head>
<body>
<div class="container mt-5">
    <h2 class="mb-4">糖尿病预测</h2>
    <form method="post" class="card p-4 shadow-sm">
        <div class="row g-3">
            <div class="col-md-6">
                <div class="mb-3">
                    <label for="preg" class="form-label">怀孕次数 (preg)</label>
                    <input type="number" min="0" step="1" class="form-control" id="preg" name="preg" required>
                </div>
            </div>
            <div class="col-md-6">
                <div class="mb-3">
                    <label for="plas" class="form-label">血浆葡萄糖浓度 (plas)</label>
                    <input type="number" min="0" step="any" class="form-control" id="plas" name="plas" required>
                </div>
            </div>
            <div class="col-md-6">
                <div class="mb-3">
                    <label for="pres" class="form-label">舒张压 (pres, 毫米汞柱)</label>
                    <input type="number" min="0" step="any" class="form-control" id="pres" name="pres" required>
                </div>
            </div>
            <div class="col-md-6">
                <div class="mb-3">
                    <label for="skin" class="form-label">三头肌皮肤褶皱厚度 (skin, 毫米)</label>
                    <input type="number" min="0" step="any" class="form-control" id="skin" name="skin" required>
                </div>
            </div>
            <div class="col-md-6">
                <div class="mb-3">
                    <label for="insu" class="form-label">2小时血清胰岛素 (insu)</label>
                    <input type="number" min="0" step="any" class="form-control" id="insu" name="insu" required>
                </div>
            </div>
            <div class="col-md-6">
                <div class="mb-3">
                    <label for="mass" class="form-label">体重指数 (mass, BMI)</label>
                    <input type="number" min="0" step="any" class="form-control" id="mass" name="mass" required>
                </div>
            </div>
            <div class="col-md-6">
                <div class="mb-3">
                    <label for="pedi" class="form-label">糖尿病谱系功能 (pedi)</label>
                    <input type="number" min="0" step="any" class="form-control" id="pedi" name="pedi" required>
                </div>
            </div>
            <div class="col-md-6">
                <div class="mb-3">
                    <label for="age" class="form-label">年龄 (age)</label>
                    <input type="number" min="0" step="1" class="form-control" id="age" name="age" required>
                </div>
            </div>
        </div>
        <button type="submit" class="btn btn-primary">提交预测</button>
    </form>
    {% if result %}
    <div class="alert alert-info mt-4" role="alert">
        {{ result }}
    </div>
    {% endif %}
    {% if error %}
    <div class="alert alert-danger mt-4" role="alert">
        {{ error }}
    </div>
    {% endif %}
    <div class="mt-4 text-center">
        <a href="/train" class="btn btn-secondary">训练模型</a>
        <a href="/wipe" class="btn btn-secondary ms-2">清除模型</a>
    </div>
</div>
<footer class="text-center mt-5 mb-3 text-muted">
    糖尿病预测服务站 &copy; 2025
</footer>
</body>
</html>